<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>新用户注册页面</title>
		<script type="text/javascript">
		 function checkForm()
		 {
			 alert("触发校验....");
				var reg = new RegExp("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$"); //正则表达式
			    var obj = document.getElementById("ema"); //要验证的对象
			    if(obj.value === ""){ //输入不能为空
			        alert("输入不能为空!");
			        return false;
			    }else if(!reg.test(obj.value)){ //正则验证不通过，格式不对
			        alert("验证不通过!");
			        return false;
			    }else{
			        alert("通过！");
			        return true;
			    }
		 }
		</script>
	</head>
	<body>
	  <form action="<%=request.getContextPath()%>/manage/email/email.do?method=register" method="post"  onsubmit="return checkForm()" >
      <table>
       <tr>
       <td>用户名：</td>
       <td><input type="text" name="username" value="张三"/></td>
       </tr>  
       <tr>
       <td>密  码：</td>
       <td><input type="text" name="password" value="11"/></td>
       </tr>    
        <tr>
       <td>邮   箱：</td>
       <td><input type="text" id="ema" name="email" value="3295358004@qq.com"/></td>
       </tr>      
      <tr>
       <td colspan="2"><input style="float: right" type="submit"  value="提交"/></td>
       </tr>  
      
      </table>
    </form>
	</body>
</html>
